﻿program DumpTest;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  PMDParse in 'PMDParse.pas';

procedure Dump(const PMDFileName: string);
var
  PMD : TPMDStream;
begin
  if FileExists(PMDFileName) then
  begin
    PMD := TPMDStream.Create(PMDFileName);
    try
      writeln(PMD.FullDUmp);
    finally
      PMD.Free;
    end;
  end
  else
    writeln('File is not found:', GetCurrentDir + PMDFileName);
end;

begin
  writeln('Dump PMD file');
  if ParamCount = 1 then
  begin
    Dump(ParamStr(1));
  end
  else
  begin
    writeln('Dumptest - PMD Dump tool');
    writeln('  DumpTest <pmd file>');
  end;
end.
